<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .demo {
            width: 50px;
            height: 50px;
            background: red;
            position: absolute;
        }
    </style>
</head>

<body>

    <script>
        window.onclick = function (e) {
            let demo = document.createElement('div')
            demo.classList.add('demo')
            demo.style.left = e.pageX + 'px'
            demo.style.top = e.pageY + 'px'
            document.body.appendChild(demo)
        }

        let fangxiang=Math.round(Math.radom())
        setInterval(()=>{
            
        })
    </script>
</body>

</html>